#include <linux/kernel.h>
#include <linux/sched/task.h>
#include <linux/sched/task_types.h>
#include <linux/refcount.h>
#include <linux/rculist.h>

void do_exit(long error_code)
{
    struct task_struct *task = current;

    list_del_rcu(&task->tasks);

    sched_task_dead();
}

void put_task_finish_switch(struct task_struct *task)
{
    /* Task is done with its stack. */
	put_task_stack(task);

    put_task_struct(task);
}
